<?php
mysql_select_db($database_tecno, $tecno);
if(isset($id)) {
 $query_detallespagos = "SELECT * FROM pagos1, detallescliente WHERE detallescliente.id='$id' AND detallescliente.idArt = pagos1.idArt  AND pagos1.status = '0' GROUP BY pagos1.idPago ORDER BY pagos1.idPago";
} else {
 $query_detallespagos = "SELECT * FROM pagos1, detallescliente, datospersonales WHERE datospersonales.id = detallescliente.id AND detallescliente.idArt = pagos1.idArt  AND pagos1.status = '0' GROUP BY pagos1.idPago ORDER BY pagos1.idPago";
}

$detallespagos = mysql_query($query_detallespagos, $tecno) or die(mysql_error());
$row_detallespagos = mysql_fetch_assoc($detallespagos);
$totalRows_detallespagos = mysql_num_rows($detallespagos);
?>
